package day05;

import java.util.Random;

//数组的演示
public class ArrayDemo {
    public static void main(String[] args) {
        int[] a = new int[4];
        int[] b = {1, 2, 3};
        int[] c = new int[]{2, 3, 4};
        int[] d;
        d = new int[]{4, 5, 6};

        int[] arr1 = new int[5];
        int[] arr2 = {1, 2, 3};
        int[] arr3 = new int[]{2, 4, 5};
        int[] arr4;
        arr4 = new int[]{3, 5, 6};
        a[0]=4;
        b[2]=1;
        System.out.println(arr1.length);
        System.out.println(b[2]);
        System.out.println(c[c.length-1]);
        //c[3]=11;
        //System.out.println(c[3]);//运行会发生数组下标越界异常
        for (int i = 0; i < arr1.length; i++) {
            arr1[i]= (int)(Math.random()*100);
            System.out.println(arr1[i]);
            
        }






    }
}
